//
//  CompanyCell.m
//  HubeiHotel
//
//  Created by LiBenCan on 17/11/17.
//  Copyright © 2017年 张露杰. All rights reserved.
//

#import "CompanyCell.h"

@implementation CompanyCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self setUpUI];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setUpUI
{
    //图片
    _imageV = [[UIImageView alloc] init];
//    _imageV.image = [UIImage imageNamed:@"touxiang02"];
    [self.contentView addSubview:_imageV];
    [_imageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(15*screenW_6));
        make.top.equalTo(@(15*screenW_6));
        make.size.mas_equalTo(CGSizeMake( 40* screenW_6,40 * screenW_6));
        make.bottom.equalTo(self.contentView).offset(-15*screenW_6);
    }];
    
    //名字
    _nameLab = [UILabel new];
    _nameLab.textColor = [UIColor colorWithHexString:@"333333"];
    _nameLab.font = [UIFont systemFontOfSize:14];
    _nameLab.textAlignment = NSTextAlignmentLeft;
    _nameLab.text = @" ";
    _nameLab.numberOfLines = 0;
    [self.contentView  addSubview:_nameLab];
    [_nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_imageV.mas_right).offset(10*screenW_6);
        make.top.equalTo(_imageV.mas_top);
        make.right.equalTo(self.contentView ).offset(-10*screenW_6);
        make.height.equalTo(@(20*screenW_6));
    }];
    
    //描述 规格
    _describLab = [UILabel new];
    _describLab.textColor = [UIColor colorWithHexString:@"#999999"];
    _describLab.font = [UIFont systemFontOfSize:11.0];
    _describLab.textAlignment = NSTextAlignmentLeft;
    _describLab.text = @" ";
    _describLab.numberOfLines = 0;
    [self.contentView  addSubview:_describLab];
    [_describLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_imageV.mas_right).offset(10*screenW_6);
        make.right.equalTo(self.contentView ).offset(-10*screenW_6);
        make.top.equalTo(_nameLab.mas_bottom).offset(0*screenW_6);
        make.height.equalTo(@(20*screenW_6));
    }];
    
}

-(void)setDataDic:(NSDictionary *)dataDic
{
    [_imageV sd_setImageWithURL:[NSURL URLWithString:dataDic[@"companyLogo"]] placeholderImage:nil];
    _nameLab.text = dataDic[@"companyName"];
    _describLab.text = [NSString stringWithFormat:@"%@｜%@｜%@",dataDic[@"financingPhase"],dataDic[@"companyNumber"],dataDic[@"industryField"]];
}

@end
